Skip to content

Automatically generate floorplan test files after placement, and enhancements to cluster attraction groups #1938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 60 commits into from
Feb 10, 2022

Conversation

sfkhalid
Copy link
Contributor

Description

This pull request includes changes that fall under 3 main categories.

First, new routines were added to the vpr constraints writer files that allow that user to generate different kinds of floorplan constraints files. Specifically, they can generate floorplan constraints that consist of
a. two partitions that each take up half the grid
b. four partitions that each take up a quadrant of the grid
c. sixteen partitions that each take up a sixteenth of the grid
d. each cluster being put into its own partition and locked to its previous spot on the grid

Second, changes were made to how the clusterer picks new molecules as candidates for the current cluster that is being packed. Specifically, the molecule gain is increased for molecules that have the same attraction group as the cluster, and decreased for molecules that do not have the same attraction group as the cluster.

Third, new checking routines were added to the clustering and placement stages to give insight on why vpr runs might fail when being run with constraints. Specifically, these routines give insight on which floorplan regions are overfilled, and by how many clusters.

Related Issue

Related to the changes being made to implement placement constraints in VPR - see issue #932 for more information

@github-actions github-actions bot added the VPR VPR FPGA Placement & Routing Tool label Dec 15, 2021
…results of runs with no attraction groups. Changed AA_PACK_MAX_HIGH_FANOUT_EXPLORE back to its original value of 10
@sfkhalid
Copy link
Contributor Author

QoR Results for this pull request:
generate_constraints_qor_comparison.xlsx

…as not outputting constraints with the correct number of blocks
@vaughnbetz
Copy link
Contributor

Please attach QoR data.

@@ -1076,6 +1076,8 @@ struct t_placer_opts {
float place_crit_limit;
int place_constraint_expand;
bool place_constraint_subtile;
int floorplan_num_horizontal_partitions;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placer opts doesn't seem like the right place for this. Seems like a constraints opts structure would be worthwhile.

@sfkhalid
Copy link
Contributor Author

sfkhalid commented Feb 3, 2022

QoR results:
qor_comparison.xlsx


if (num_available_atoms < 500) {
for (AtomBlockId atom_id : group.group_atoms) {
const auto& atom_model = atom_ctx.nlist.block_model(atom_id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like duplicate code -- factor this and the code below into a helper function to avoid duplication (or more than one if necessary).

return;
}

if (num_available_atoms < 500) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a named constant instead of 500

VTR_LOG("Floorplan regions are overfull: trying to pack again with more attraction groups exploration and higher target pin utilization. \n");
attraction_groups.create_att_groups_for_overfull_regions();
VTR_LOG("Pack iteration is %d\n", pack_iteration);
attraction_groups.set_att_group_pulls(4);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think about using defined constants for all these numbers (2, 5, 4 ...). Can define in a block right above this code and comment what each does and why they have the values they do.

type_count[i_col][j_row] = 0;

if (is_tile_compatible(tile, block_type)) {
if (is_tile_compatible(tile, block_type) && grid_tile.height_offset == 0 && grid_tile.width_offset == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Legal anchor location to place this block.


for (auto blk_id : cluster_ctx.clb_nlist.blocks()) {
if (place_ctx.block_locs[blk_id].loc.x == INVALID_X) {
VTR_LOG("Block %s (# %d) of type %s could not be placed during initial placement\n", cluster_ctx.clb_nlist.block_name(blk_id).c_str(), blk_id, cluster_ctx.clb_nlist.block_type(blk_id)->name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also print its floorplan constraint: say whether constrained or not, and what the constraint is.
Can also say if it is part of a placement macro, and if it is, give the other macro members and offsets.

@vaughnbetz
Copy link
Contributor

Please add Titan QoR.
OK to merge and fix the remaining code comments afterward if you wish. Or if you're waiting and want to fix them now go ahead ... your call.

@sfkhalid
Copy link
Contributor Author

sfkhalid commented Feb 4, 2022

Titan qor comparison:
titan_qor_comparison.xlsx
No significant increase in pack time, place time, total runtime. Critical path delay, number of blocks, and total wirelength also look fine.

@sfkhalid
Copy link
Contributor Author

sfkhalid commented Feb 4, 2022

@vaughnbetz If the titan results look ok to you, is this ok to be merged?

@sfkhalid
Copy link
Contributor Author

sfkhalid commented Feb 7, 2022

@vaughnbetz If the qor looks ok, can we merge this PR? I can address the comments asap on a second PR when this one is merged.

@sfkhalid
Copy link
Contributor Author

Another run of the titan comparison:
titan_qor_comparison_2.xlsx

@vaughnbetz vaughnbetz changed the title Generate test constraints files Automatically generate floorplan test files after placement, and enhancements to cluster attraction groups Feb 10, 2022
@vaughnbetz vaughnbetz merged commit fb75430 into master Feb 10, 2022
@vaughnbetz vaughnbetz deleted the generate_test_constraints_files branch February 10, 2022 16:20
@vaughnbetz
Copy link
Contributor

Thanks @ArashAhmadian . @sfkhalid : can you comment? We really need to get the floorplan constraints working -- do you have any time to look at this in the near future?

@saaramahmoudi has made a PR to make initial placement try to pack macros densely, which solves another issue. But I think there is still a fundamental bug in the attraction groups.

@ArashAhmadian
Copy link
Contributor

@vaughnbetz @sfkhalid Yes, it would be great if this could be fixed soon :) . Also, BB wire length estimation is currently not getting logged (commented out in vpr/src/place/place.cpp) and as a result placment_wire_length in parse_results.txt is missing (regex in parse config is here vtr_flow/parse/parse_config/common/vpr.place.txt). Is there a particular reason for this? @sfkhalid

@vaughnbetz
Copy link
Contributor

I don't know why that was commented out -- probably worth changing that back. It was confusing @jmah76 too.

@sfkhalid
Copy link
Contributor Author

sfkhalid commented Aug 5, 2022

Thanks @ArashAhmadian . @sfkhalid : can you comment? We really need to get the floorplan constraints working -- do you have any time to look at this in the near future?

@saaramahmoudi has made a PR to make initial placement try to pack macros densely, which solves another issue. But I think there is still a fundamental bug in the attraction groups.

Thanks @ArashAhmadian. It is possible that there is a bug introduced in this branch, but I think the bug in the attraction groups is from code that was merged after this branch (not from this branch itself) because there were many tests I ran that used attraction groups that would pass on this branch but fail once I had merged in new code. I'll try to resolve the attraction groups issue in the coming week.

For the commented out line, there is no particular reason for that, it can be added back in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants